/**
* @version:1.0
* @author kevinnan.org.cn  nanche@mail.hfut.edu.cn
* @date 2020/11/30
* @Content:大津阈值分割法
*/

#ifndef OSTU_ACHIEVE
#define OSTU_ACHIEVE

#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <cmath>
#include <opencv2/highgui.hpp>
#include <opencv2/core.hpp>
#include <opencv2/imgproc.hpp>
#include "matplotlibcpp.h"

typedef unsigned char uchar;

namespace plt = matplotlibcpp;


class ostu{
public:
	ostu();

	ostu(std::string imagePath);

	/**
	  * 绘制直方图
	  */
	void drawHistogram(cv::Mat image);


	/**
	  * 直方图均衡
	  */
	cv::Mat equalizeHistogram();

	/**
	  * OpenCV提供的大津阈值法测试
	  */
	void opencvOSTUtest();


	/**
	  *OSTU实现
	  */
	void ostuAchieve();

private:
	cv::Mat originImage;
};


#endif 


